#pragma once
#include "stdafx.h"

	enum MsgId
	{
		//No used
		MSG_PING=0,

		//Create a buffer use ID3D11Device::CreateBuffer method
		//Parameter:
		//1. D3D11_BUFFER_DESC reference
		//2. D3D11_SUBRESOURCE_DATA reference
		//3. ID3D11Buffer* reference
		MSG_CREATE_BUFFER,
		//Create a depth-stencil state object use ID3D11Device::CreateDepthStencilState method
		//Parameter:
		//1. D3D11_DEPTH_STENCIL_DESC reference
		//2. ID3D11DepthStencilState* reference
		MSG_CREATE_DEPTH_STENCIL_STATE,
		//Create an input-layout object use ID3D11Device::CreateInputLayout method
		//Parameter:
		//1. D3D11_INPUT_ELEMENT_DESC reference
		//2. UINT
		//3. ID3DBlob*
		//4. ID3D11InputLayout* reference
		MSG_CREATE_INPUT_LAYOUT,
		//Create a pixel shader use ID3D11Device::CreatePixelShader method
		//Parameter:
		//1. const void*
		//2. SIZE_T
		//3. ID3D11PixelShader* reference
		MSG_CREATE_PIXEL_SHADER,
		//Create a rasterizer state object use ID3D11Device::CreateRasterizerState method
		//Parameter:
		//1. D3D11_RASTERIZER_DESC reference
		//2. ID3D11RasterizerState* reference
		MSG_CREATE_RASTERIZER_STATE,
		//Create an array of 1D textures use ID3D11Device::CreateTexture1D method
		//Parameter:
		//1. D3D11_TEXTURE1D_DESC reference
		//2. D3D11_SUBRESOURCE_DATA reference
		//3. ID3D11Texture1D* reference
		MSG_CREATE_TEXTURE1D,
		//Create an array of21D textures use ID3D11Device::CreateTexture2D method
		//Parameter:
		//1. D3D11_TEXTURE2D_DESC reference
		//2. D3D11_SUBRESOURCE_DATA reference
		//3. ID3D11Texture2D* reference
		MSG_CREATE_TEXTURE2D,
		//Create an array of 3D textures use ID3D11Device::CreateTexture3D method
		//Parameter:
		//1. D3D11_TEXTURE3D_DESC reference
		//2. D3D11_SUBRESOURCE_DATA reference
		//3. ID3D11Texture3D* reference
		MSG_CREATE_TEXTURE3D,
		//
		MSG_CREATE_TEXTURE,
		//Create a vertex shader use ID3D11Device::CreateVertexShader method
		//Parameter:
		//1. ID3DBlob*
		//2. ID3D11VertexShader* reference
		MSG_CREATE_VERTEX_SHADER,
		//Sets the depth-stencil state of the output-merger stage.
		//Parameter:
		//1. ID3D11DepthStencilState*
		MSG_SET_DSS,
		//Bind one or more render targets atomically and the depth-stencil buffer to the output-merger stage.
		//Parameter:
		//1. Vector< ID3D11RenderTargetView* >
		//2. ID3D11DepthStencilView*
		MSG_SET_RT,
		//Set the rasterizer state for the rasterizer stage of the pipeline.
		//Parameter:
		//1. ID3D11RasterizerState*
		MSG_SET_RS,
		//Bind an array of viewports to the rasterizer stage of the pipeline.
		//Parameter:
		//1. Vector< ID3D11Viewport* >
		MSG_SET_VIEWPORT,
		//Set all the elements in a render target to one value.
		//Parameter:
		//1. ID3D11RenderTargetView*
		//2. D3DXCOLOR*
		MSG_CLEAR_RTV,
		//Clears the depth-stencil resource.
		//Parameter
		//1. ID3D11DepthStencilView*
		//2. D3D11_CLEAR_FLAG
		//3. float
		//4. UINT8
		MSG_CLEAR_DSV,
		//Set the blend state of the output-merger stage.
		//Parameter
		//1. ID3D11BlendState*
		//2. float*
		//3. unsigned int
		MSG_SET_BS,
		//Bind an array of shader resources to the pixel shader stage.
		//Parameter
		//1. unsigned int
		//2. unsigned int
		//3. ID3D11ShaderResourceView*
		MSG_SET_SR_PS,
		//Update ID3D11Buffer 
		MSG_UPDATE_BUFFER,
		//Sets the constant buffers used by the vertex shader pipeline stage.
		//Parameter
		//1. unsigned int
		//2. unsigned int
		//3. ID3D11Buffer*
		MSG_SET_CB_VS,
		//Sets the constant buffers used by the vertex shader pipeline stage.
		//Parameter
		//1. unsigned int
		//2. unsigned int
		//3. ID3D11Buffer*
		MSG_SET_CB_PS,
		//Bind an input-layout object to the input-assembler stage.
		//Parameter
		//1. ID3D11InputLayout*
		MSG_SET_IL,
		//Set a vertex shader to the device.
		//Parameter
		//1. ID3D11VertexShader*
		//2. ID3D11ClassInstance*
		//3. unsigned int
		MSG_SET_VSS,
		//Sets a pixel shader to the device.
		//Parameter
		//1. ID3D11PixelShader*
		//2. ID3D11ClassInstance*
		//3. unsigned int
		MSG_SET_PSS,
		//Bind an array of vertex buffers to the input-assembler stage.
		//Parameter
		//1. unsigned int
		//2. unsigned int
		//3. ID3D11Buffer*
		//4. unsigned int*
		//5. unsigned int*
		MSG_SET_VB,
		//Bind an index buffer to the input-assembler stage.
		//Parameter
		//1. ID3D11Buffer*
		//2. DXGI_FORMAT
		//3. unsigned int
		MSG_SET_IB,
		//Bind information about the primitive type, and data order that describes input data for the input assembler stage.
		//Parameter
		//1. D3D11_PRIMITIVE_TOPOLOGY
		MSG_SET_PT,
		//Draw indexed, non-instanced primitives.
		//1. unsigned int
		//2. unsigned int
		//3. int
		MSG_DI,
		//Set an array of sampler states to the pixel shader pipeline stage.
		//Parameter
		//1. unsigned int
		//2. unsigned int
		//3. ID3D11SamplerState*
		MSG_DRAW,
		//Present a rendered image to the user.
		//No parameter
		MSG_PRESENT,
		//Draw non-indexed, non-instanced primitives.
		//Parameter
		//1. unsigned int
		//2. unsigned int
		MSG_SET_SAMPLERS_PS,
		//No used any more
		MSG_COMPARE_SHARED,
		//Create a sampler-state object that encapsulates sampling information for a texture.
		//Parameter
		//1. D3D11_SAMPLER_DESC*
		//2. ID3D11SamplerState**
		MSG_CREATE_SAMPLER,
		//Creates an effect from a binary effect or file.
		//Parameter
		//1. string
		//2. Effect::sPtr*
		MSG_CREATE_EFFECT,
		//Reset all the state in device context.
		//No parameter
		MSG_RESET_ALL_STATE,
		//Load the texture, texture could be three type 1D, 2D or 3D.
		MSG_LOAD_TEXTURE,
		//Load the Mesh, Mesh could be static or animated, and one mesh could has several sub meshs. 
		//Parameter
		//1. string, the path of this mesh.
		MSG_LOAD_MESH,
		//Load the Model
		//Parameter
		//1. string, the path of this model.
		MSG_LOAD_MODEL,
		
		//Add a render object in render queue(QueueMain)
		//Parameter
		//1. RenderObject::sPtr
		MSG_ADD_RENDER_OBJECT,
		//Remove a render object in render queue
		//Parameter
		//1. string
		//2. QueueFormat
		MSG_REMOVE_RENDER_OBJECT,
		//Clear all render queue in render object manager
		//No parameter
		MSG_REMOVE_ALL_RENDER_QUEUE,

		//Find the path about a specificed resource
		//Parameter
		//1. string
		//2. string*
		MSG_GET_PATH,
		//Load resource when it's exists
		//Parameter
		//1. string
		//2. Resource::ResourceType
		//3. Resource::sPtr*
		MSG_GET_RESOURCE,
		//Remove a resource in resource manager
		//Parameter
		//1. Resource::ResourceType
		//2. string
		MSG_REMOVE_RESOURCE,
		//Remove all the resource in resource manager
		//No parameter
		MSG_REMOVE_ALL_RESOURCE,
		
		MSG_DUMP_ALL_MESSAGE,
		//Not implement now.
		MSG_LOG,

		
		MSG_SAVE_CONFIG,
		
		
		//Call an function in LUA script
		//Parameter
		//1. string
		MSG_RUN_SCRIPT,
		
		//Send at the beginning of the program, to inform all the components initial the device, resource and so on...
		//Parameter:
		//1. HINSTANCE m_hinstance reference
		//2. HWND m_hwnd reference
		//3. int screen_width reference
		//4. int screen_height reference
		MSG_INITIAL,
		//Send an initial message to the component which is related with graphic
		//Parameter:
		//1. HINSTANCE m_hinstance reference
		//2. HWND m_hwnd reference
		//3. int screen_width reference
		//4. int screen_height reference
		MSG_INITIAL_GRAPHICS,
		//Send an initial message to the component which is related with logic
		//No paramater
		MSG_INITIAL_LOGIC,
		//Send an initial message to prepare game data.
		//No parameter
		MSG_INITIAL_GAME_DATA,
		
		//Get the view matrix
		//Parameter
		//1. XMMatrix*
		MSG_GET_VIEW_MATRIX,
		//Get the perspective matrix
		//Parameter
		//1. XMMatrix*
		MSG_GET_PERSP_MATRIX,
		
		//Move up the camera
		//No parameter
		MSG_CAMERA_UP,
		//Move down the camera
		//No parameter
		MSG_CAMERA_DOWN,
		//Move left the camera
		//No parameter
		MSG_CAMERA_LEFT,
		//Move right the camera
		//No parameter
		MSG_CAMERA_RIGHT,
		//Round the camera left
		//No parameter
		MSG_CAMERA_RLEFT,
		//Round the camera right
		//No parameter
		MSG_CAMERA_RRIGHT,
		//Move the camera into the screen
		//No parameter
		MSG_CAMERA_IN,
		//Move the camera out of the screen
		//No parameter
		MSG_CAMERA_OUT,
		MSG_TIME_INCR

	};

	enum CompName
	{
		COMP_GRAPHICS=0,
		COMP_DEVICE,
		COMP_DEVICE_CONTEXT,
		COMP_INPUT,
		COMP_CAMERA,
		COMP_SYSTEM,
		COMP_RESOURCE,
		COMP_RESOURCE_MAPPING,
		COMP_TEXTURE_LOADER,
		COMP_DATA_STREAM,
		COMP_MESH,
		COMP_MESH_LOADER,
		COMP_RENDER_OBJ_MANGER,
		COMP_RENDER_QUEUE,
		COMP_MODEL,
		COMP_MODEL_LOADER,
		COMP_LOG,
		COMP_LOGIC,
		COMP_CONFIG,
		COMP_SCRIPT,
		COMP_EFFECT,
		COMP_TECH,
		COMP_CONTROL,
		COMP_TIMER
	};

	enum ObjectName
	{
		OBJ_HID=0,
		OBJ_CORE,
		OBJ_RESOURCE,
		OBJ_GRAPHICS,
		OBJ_GAME,
		OBJ_ANIM,
		OBJ_CAMERA,
		OBJ_SOUND
	};
